﻿using System.Runtime.Serialization;
using System.Windows.Media.Media3D;
namespace GameBoard
{
    [DataContract]
    public class ConeVisualFactory : BaseVisualFactory, IChangeLocations
    {
        public ConeVisualFactory(ConeVisualData shape)
            : base(shape)
        {
        }

        public override ModelVisual3D MakeVisual()
        {
            var cv = new ConeVisual();
            cv.PopulateVisualData(VisualData);
            return cv.VisualElement;
        }

        public void SetLocation(Point3D newLocation)
        {
            var data = VisualData as ConeVisualData;
            data.Origin = newLocation;
        }
    }
}